<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>员工信息</title>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>"/>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>"/>
</head>
<body>
<script type="text/javascript">
	$(function(){
		var all_out_layout =function(texttitle){
			$(".add_success_ok").text(texttitle).prop(texttitle);
			$(".all_out_layout").panel("open");
			window.setInterval(function(){
				$(".all_out_layout").panel("close");
			},2000);
		}
		
		$(".emp_insert").linkbutton({
			onClick:function(){
				$(".emp_message").panel({
					href:"empmessage_insert"
					
				})
			}
		})
		$(".emp_update").linkbutton({
			onClick:function(){
				var table = $("#table").datagrid("getSelected");
				var stainId = null;
				if(table==null){
					all_out_layout("请选择要修改的用户");
				}else{
					stainId = table.stainId;
					$(".emp_message").panel({
						href:"empmessage_update?id="+stainId
						
					})
				}
			}
		});
		
		$("#search-emp-yj").linkbutton({
			onClick:function(){
				var mess = $("#mess-emp-yj").textbox("getText");
				$("#table").datagrid('load', 'find-like-staff-yj?name=' + mess);
				$("#mess-emp-yj").textbox("setText","")
			}
		});
		
		$(".emp_delete").linkbutton({
			onClick:function(){
				
				var table = $("#table").datagrid("getSelected");
				var stainId = null;
				if(table==null){
					all_out_layout("请选择要离职的用户");
				}else{
					stainId = table.stainId;
					$(".emp_message").panel({
						href:"empmessage_delete?id="+stainId
						
					})
				}
			}
		});
		
	});
</script>
<div class="easyui-panel emp_message" data-options="fit:true,border:false">

<div id="toolbar" width="400" >
			<a class="easyui-linkbutton emp_insert"  iconCls="icon-add" plain="true">添加</a> 
			<a class="easyui-linkbutton emp_update" iconCls="icon-edit" plain="true">修改</a>
			<a class="easyui-linkbutton emp_delete" iconCls="icon-remove" plain="true">删除</a>
			<input id="mess-emp-yj"  class="easyui-textbox" data-options="iconCls:'icon-search'" style="width:200px"> 
			<a id="search-emp-yj" class="easyui-linkbutton" iconCls="icon-remove" plain="true">搜索</a>
</div>

<table id="table" class="easyui-datagrid" data-options="
				fitColumns:true,
				fit:true,
				singleSelect:true,
				newrap:true,
				rownumbers:true,
				pagination:true,
				pageList:[5,10,15,20],
				pageSize:5,
				toolbar:'#toolbar',
				border:false,
				url:'find-staff-yj'
	">
		<thead>
			<tr>
				<th data-options="field:'stainId',width:30,align:'center'">员工编号</th> 
	            <th data-options="field:'stainName',width:50,align:'center'">员工姓名</th>   
	            <th data-options="field:'stainSex',width:50,align:'center'">性别</th> 
	            <th data-options="field:'defideName',width:50,align:'center',
					formatter: function(value,row,index){
					return new Object(row['definitionDept']).defideName;
					} ">部门</th>
	            
	              <th data-options="field:'zcName',width:100,align:'center',
					formatter: function(value,row,index){
					return new Object(row['professionalTitle']).zcName;
					} ">职称</th>
					 <th data-options="field:'eduName',width:50,align:'center',
					formatter: function(value,row,index){
					return new Object(row['edubackground']).eduName;
					} ">学历</th>
					<th data-options="field:'jobsName',width:50,align:'center',
					formatter: function(value,row,index){
					return new Object(row['jobStatus']).jobsName;
					} ">用工状态</th>
					
					
					<th data-options="field:'stainPolitics',width:50,align:'center'">政治面貌</th>  
					<th data-options="field:'stainDate',width:100,align:'center',
							formatter:function(value,row,index){
							var date = new Date(value);
							return date.toLocaleString();
					}">入司时间</th> 
	            <!--   
	            <th data-options="field:'jobsName',width:50,align:'center'">用工状态</th>   
	            
	             -->
			</tr>		
		</thead>
		
	</table>
</div>
</body>
</html>